package com.lehecai.core.api.event;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.lehecai.core.IntegerBeanLabelItem;

/**
 * 验证模式
 * @author He Wang
 *
 */
public class PropExchangeCardVerifyMode extends IntegerBeanLabelItem {
	private static final Logger logger = LoggerFactory.getLogger(PropExchangeCardVerifyMode.class.getName());
	private static final long serialVersionUID = -2655180046354667807L;
	
	private static List<PropExchangeCardVerifyMode> items = new ArrayList<PropExchangeCardVerifyMode>();
	private static List<PropExchangeCardVerifyMode> queryItems = new ArrayList<PropExchangeCardVerifyMode>();
	
	protected PropExchangeCardVerifyMode(String name, int value, boolean queryOnly) {
		super(PropExchangeCardVerifyMode.class.getName(), name, value);
		queryItems.add(this);
		if (!queryOnly) {
			items.add(this);
		}
	}
	
	protected PropExchangeCardVerifyMode(String name, int value) {
		this(name, value, false);
	}
	
	public static PropExchangeCardVerifyMode getItem(int value){
		try {
			return (PropExchangeCardVerifyMode)PropExchangeCardVerifyMode.getResult(PropExchangeCardVerifyMode.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<PropExchangeCardVerifyMode> getItems() {
		return items;
	}
	
	public static List<PropExchangeCardVerifyMode> getQueryItems() {
		return queryItems;
	}

	public static final PropExchangeCardVerifyMode ALL = new PropExchangeCardVerifyMode("全部", -1, true);
	public static final PropExchangeCardVerifyMode RECHARGE_DISCOUNT_CARD = new PropExchangeCardVerifyMode("卡号验证", 1);
}
